//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "DPEmail.h"
#include "DModule.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "DialPad"
#pragma link "PHDS"
#pragma link "PHCheck"
#pragma link "PHEdit"
#pragma link "PHLabel"
#pragma resource "*.dfm"
TDPEmail1 *DPEmail1;
//---------------------------------------------------------------------------
__fastcall TDPEmail1::TDPEmail1(TComponent* Owner)
    : TDiPad(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TDPEmail1::FormCreate(TObject *Sender)
{
  DSEmail->Tabela = DM->TBSenhas;
  DSEmail->Open(false);
  if (DSEmail->BuscaKeyBD(SENHAS_CODUSUARIO, vg.Usuario, true, true))
   DSEmail->Edit();
  else
   DSEmail->Insert();
}
//---------------------------------------------------------------------------

void __fastcall TDPEmail1::BtnCancelarClick(TObject *Sender)
{
  this->Close();
}
//---------------------------------------------------------------------------

void __fastcall TDPEmail1::BtnSalvarClick(TObject *Sender)
{
  DSEmail->SV(SENHAS_CODUSUARIO, 0, vg.Usuario);
  DSEmail->Post();
}
//---------------------------------------------------------------------------

void __fastcall TDPEmail1::BitBtn1Click(TObject *Sender)
{

  DSEmail->State = phDelete;
}
//---------------------------------------------------------------------------

